import Vue from 'vue'
import Vuex from 'vuex'
import formatTime from '../utils/FormatTime.js'
Vue.use(Vuex)

const store = new Vuex.Store({
	state:{
		loginTimes:1,
		loginTime:formatTime(new Date()),
		adminLoginTimes:1,
		adminLoginTime:formatTime(new Date())
	},
	mutations:{
		addTimes(state,step){
			state.loginTimes += step
			state.adminLoginTimes += step
		},
		updateTime(state){
			state.loginTime = formatTime(new Date())
			state.adminLoginTime = formatTime(new Date())
		}
	},
	actions:{
		
	}
})

export default store